<template>
    <div class="viewDetails32">
        <!-- 头部 -->
        <!-- <div class="header">
            <x-icon type="ios-arrow-left" size="" class="icon-white" @click="$router.go(-1)"></x-icon>安全检查
        </div> -->
        <!-- 内容部分 -->
        <div class="safeDetails32">
            <ul class="ul1">
                <li class="clearfix">
                    <span class="spa">检查编号</span>
                    <em>{{listArr.No}} </em>
                </li>
                <li class="clearfix">
                    <span class="spa">被检查单位</span>
                    <em>{{listArr.projectName}}</em>
                </li>
                <li class="clearfix"
                    v-if="listArr.CheckName">
                    <span class="spa">检查名称</span>
                    <em>{{listArr.CheckName}}</em>
                </li>
                <li class="clearfix">
                    <span class="spa">检查类型</span>
                    <em>{{listArr.checkType}}</em>
                </li>
                <li class="clearfix">
                    <span class="spa">检查时间</span>
                    <em>{{listArr.checkTime}}</em>
                </li>
                <li class="clearfix"
                    v-if="listArr.checkArea">
                    <span class="spa">检查区域</span>
                    <em>{{listArr.checkArea}}</em>
                </li>
                <li class="clearfix"
                    v-if="listArr.checkContent">
                    <span class="spa">检查内容</span>
                    <em>{{listArr.checkContent}}</em>
                </li>
                <li class="clearfix"
                    v-if="listArr.checkImportant">
                    <span class="spa">检查重点</span>
                    <em>{{listArr.checkImportant}}</em>
                </li>
            </ul>
            <ul class="ul1"
                style="margin-top:10px;">
                <li class="clearfix">
                    <span class="spaTitle">检查组成员及分工</span>
                </li>
                <li class="clearfix"
                    v-if="listArr.checkGroupLeaderName">
                    <span class="spa">检查组长</span>
                    <em>{{listArr.checkGroupLeaderName}} </em>
                </li>
                <ul class="ul_in"
                    v-for="(item,index) in listArr.checkMemberList"
                    :key="index">
                    <li class="clearfix">
                        <span class="spa">成员</span>
                        <em>{{item.memberName}}
                            <span class="sp"
                                  v-if="!item.IsSubmitted">(未提交)</span>
                        </em>
                    </li>
                    <li class="clearfix">
                        <span class="spa">分工</span>
                        <em>{{item.memberWork}} </em>
                    </li>
                </ul>
            </ul>
            <div class="ul3">
                <h3>检查记录
                    <span v-if="listArr.checkType!='日常检查'">({{listArr.TotalScore}} 分)</span>
                </h3>
                <div class="standard-wrap">
                    <div v-for="(item,index) in  listArr2"
                         v-bind:key="index"
                         class="item-wrap">
                        <standardItem :item="item"
                                      :showChild="showChild"
                                      :selectStandard="selectStandard"></standardItem>
                    </div>
                </div>
            </div>
            <ul class="ul1"
                style="margin-top:10px;">
                <li class="clearfix">
                    <span class="spaTitle"
                          style="width:200px">通知单</span>
                </li>
                <li class="clearfix"
                    v-if="list1">
                    <span class="spa"
                          style="width:200px">隐患整改通知单</span>
                    <em style="width:100px;"
                        @click="$router.push({path:'./safe2Reform',query:{type:'HiddenDangerId1',name:'隐患整改通知单',id:param2.data.id}})">
                        <x-icon type="ios-arrow-right"
                                size="20"
                                style="margin-top:4px;margin-right:10px"></x-icon>
                    </em>
                </li>
                <li class="clearfix"
                    v-if="list2">
                    <span class="spa"
                          style="width:200px">设备停用通知单</span>
                    <em style="width:100px"
                        @click="$router.push({path:'./safe2Reform',query:{type:'HiddenDangerId2',name:'设备停用通知单',id:param2.data.id}})">
                        <x-icon type="ios-arrow-right"
                                size="20"
                                style="margin-top:4px;margin-right:10px"></x-icon>
                    </em>
                </li>
                <li class="clearfix"
                    v-if="list3">
                    <span class="spa"
                          style="width:200px">停工通知单</span>
                    <em style="width:100px"
                        @click="$router.push({path:'./safe2Reform',query:{type:'HiddenDangerId3',name:'停工通知单',id:param2.data.id}})">
                        <x-icon type="ios-arrow-right"
                                size="20"
                                style="margin-top:4px;margin-right:10px"></x-icon>
                    </em>
                </li>
            </ul>
            <!-- <div class="btn">
                提交
            </div> -->
        </div>
        <myMenu @clickBack="back"
                backPath='/safeView2'></myMenu>
    </div>
</template>
<script>
import { Actionsheet, Cell, Group, CellBox } from 'vux'
import standardItem from './select2'
import myMenu from '@/commonComponents/menu'
export default {
    components: {
        Actionsheet,
        Group,
        Cell,
        CellBox,
        standardItem,
        myMenu
    },
    data () {
        return {
            ind: 9999,
            showContent001: false,
            param: {
                allowPaging: true,
                business: 'getSafeCheckDetail',
                data: {
                    safeCheckIdItem: ''
                },
                pageIndex: 0,
                pageSize: 20,
                tokenId: 'D0853C0CE5A6A478F5C613B840394FC3',
                userId: ''
            },
            listArr: [],
            listArr2: [],
            param2: {
                allowPaging: true,
                business: 'GetCheckWorkHiddenDangers',
                data: {
                    CategoryId: '',
                    id: ''
                },
                pageIndex: 0,
                pageSize: 1000,
                tokenId: 'D0853C0CE5A6A478F5C613B840394FC3',
                userId: ''
            },
            list1: false,
            list2: false,
            list3: false
        }
    },
    created () {
        var token = JSON.parse(window.localStorage.getItem('userInfo'))
        this.param2.userId = token.userid
        this.param.userId = token.userid
        this.param.data.safeCheckIdItem = this.$route.query.id
        this.param2.data.id = this.$route.query.id
    },
    mounted () {
        this.dataArr()
        this.dataArr2()
    },
    methods: {
        back () {

        },
        showChild (deptId, item) {
            item.open = !item.open
        },
        selectStandard (item) {
            item.checked = !item.checked
        },
        click (key, item) {
            console.log(key, item)
        },
        show (i) {
            this.ind = i
        },
        // 主要数据
        dataArr () {
            this.$axiosAjax.getConfigJson(this.param).then((res) => {
                if (res.status) {
                    this.listArr = res.data.data
                    // this.total=res.data.count
                    console.log(this.listArr.equStopList, 123)
                    if (this.listArr.problemModifyList.length > 0) {
                        this.list1 = true
                    }
                    if (this.listArr.equStopList.length > 0) {
                        this.list2 = true
                    }
                    if (this.listArr.trbStopList.length > 0) {
                        this.list3 = true
                    }
                }
            }
            )
        },
        // 检查记录下的数据
        dataArr2 () {
            this.$axiosAjax.getConfigJson(this.param2).then((res) => {
                if (res.status) {
                    var arr = res.data.data
                    var a = []
                    for (var k of arr) {
                        for (var j of k.problemSummaries) {
                            a.push(j.No)
                            j.checked = false
                        }
                        k.open = false
                    }
                    this.total = a.length
                    this.listArr2 = arr
                }
            })
        }
    }
}
</script>
<style lang="less" scoped>
.viewDetails32 {
    width: 100%;
    height: 100%;
    .header {
        width: 100%;
        height: 40px;
        line-height: 40px;
        text-align: center;
        position: relative;
        font-size: 18px;
        background: #2269ff;
        color: #fff;
        .vux-x-icon {
            fill: cornsilk;
            position: absolute;
            left: 0;
            top: 5px;
            width: 30px;
            height: 30px;
        }
    }
    .safeDetails32 {
        height: 100%;
        width: 100%;
        background-color: #ebeef2;
        padding-top: 10px;
        .ul1 {
            width: 100%;
            padding: 0 10px;
            background-color: #fff;
            margin-bottom: 10px;
            li,
            li .ul_in {
                padding: 10px 0;
                border-bottom: 1px solid #eee;
                width: 100%;
                height: 50px;
                line-height: 30px;
                position: relative;
                .vux-x-icon {
                    fill: #999;
                    float: right;
                    position: absolute;
                    top: 12px;
                    right: -10px;
                }
                .spa {
                    // float: left;
                    width: 96px;
                    font-size: 14px;
                    color: #333;
                }
                .spaTitle {
                    float: left;
                    height: 30px;
                    line-height: 30px;
                    font-size: 16px;
                    width: 196px;
                    color: #2269ff;
                }
                em {
                    float: right;
                    width: 240px;
                    height: 30px;
                    font-size: 14px !important;
                    line-height: 30px;
                    text-align: right;
                    margin-right: 10px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    color: #999;
                    .sp {
                        color: red !important;
                    }
                }
                .vux-cell-value {
                    float: right;
                    margin-right: 20px;
                }
            }
        }
        .ul3 {
            background-color: #fff;
            padding: 0 0 0 10px;
            h3,
            h4 {
                margin-top: 10px;
                height: 40px;
                line-height: 40px;
                font-size: 16px;
                color: #2269ff;
                padding: 0;
                border-bottom: 1px solid #eee;
                background-color: #fff;
                span {
                    font-size: 16px;
                    height: 40px;
                    line-height: 40px;
                    color: #999;
                }
                em {
                    font-size: 14px;
                    float: right;
                    height: 20px;
                    .vux-x-icon {
                        fill: #09c13b;
                        margin-top: 8px;
                    }
                }
            }
            h4 {
                font-size: 16px;
                color: #333;
                em {
                    position: relative;
                    .vux-x-icon {
                        fill: #999;
                        float: right;
                        width: 30px;
                        height: 30px;
                        margin-top: 6px;
                    }
                }
            }
        }
        .btn {
            width: 200px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            border-radius: 25px;
            background-color: #2269ff;
            margin: 40px auto;
            color: #fff;
        }
    }
    .weui-cell {
        padding: 10px;
        border-bottom: 1px solid #eee;
    }
    .vux-label {
        font-size: 16px;
    }
    .weui-cells {
        margin-top: 0;
    }
    .weui-cell__ft {
        em {
            font-size: 14px;
        }
    }
    .dele {
        overflow: hidden;
        background-color: #fff;
        .list-item {
            position: relative;
            height: 120px;
            -webkit-transition: all 0.2s;
            transition: all 0.2s;
            border-bottom: 1px solid #eee;
            .list-box {
                padding: 0 10px;
                display: flex;
                align-items: center;
                -webkit-box-sizing: border-box;
                box-sizing: border-box;
                justify-content: flex-end;
                position: absolute;
                top: 0;
                right: 0;
                bottom: 0;
                left: 0;
                font-size: 0;
                .list_Left {
                    float: left;
                    width: 220px;
                    height: 120px;
                    h2 {
                        width: 100%;
                        font-size: 18px;
                        margin-top: 14px;
                    }
                    p {
                        font-size: 16px;
                        width: 100%;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                        margin-top: 14px;
                    }
                    h5 {
                        margin-top: 14px;
                        font-size: 16px;
                        width: 100%;
                        em {
                            color: #ffb400;
                        }
                    }
                }
                .list_Right {
                    width: 150px;
                    height: 126px;
                    float: right;
                    padding: 14px 0;
                    img {
                        width: 100%;
                        height: 100%;
                        // border: 1px solid #fff;
                        border-radius: 5px;
                    }
                }
            }
        }
        .n1 {
            color: #fe0100;
        }
        .n2 {
            color: #ff7034;
        }
    }
    .affirm-wrap {
        position: fixed;
        z-index: 5;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ebeef2;
    }
    .standard-name {
        padding: 20px 0 24px 10px;
        margin-right: 10px;
    }
    .standard-name > span {
        margin-left: 20px;
        font-size: 14px !important;
    }
    .iconfont {
        margin-left: 20px;
    }
    .item-wrap {
        // padding-left: 20px;
        background: #fff;
        position: relative;
        z-index: 2;
        margin-top: 5px;
    }
}
</style>
